package com.cmc.cloud.cmclink.doc.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 邮件发送任务单 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
public class EmailSendTaskBaseVO {

    private Long id;

    @Schema(description = "申请号", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 20)
    @NotBlank(message = "{emailsendtask.applyno.notblank}")
    @Length(max = 20, message = "{emailsendtask.applyno.length}")
    private String applyNo;

    @Schema(description = "订舱号", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 20)
    @NotBlank(message = "{emailsendtask.bookingno.notblank}")
    @Length(max = 20, message = "{emailsendtask.bookingno.length}")
    private String bookingNo;

    @Schema(description = "接舱方", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 5)
    @NotBlank(message = "{emailsendtask.spaceowner.notblank}")
    @Length(max = 5, message = "{emailsendtask.spaceowner.length}")
    private String spaceOwner;

    @Schema(description = "操船方", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 20)
    @NotBlank(message = "{emailsendtask.carrier.notblank}")
    @Length(max = 20, message = "{emailsendtask.carrier.length}")
    private String carrier;

    @Schema(description = "货物类型", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 5, example = "1")
    @NotBlank(message = "{emailsendtask.cargotype.notblank}")
    @Length(max = 5, message = "{emailsendtask.cargotype.length}")
    private String cargoType;

    @Schema(description = "船名", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 50)
    @NotBlank(message = "{emailsendtask.vesselcode.notblank}")
    @Length(max = 50, message = "{emailsendtask.vesselcode.length}")
    private String vesselCode;

    @Schema(description = "航次", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 50)
    @NotBlank(message = "{emailsendtask.voyageex.notblank}")
    @Length(max = 50, message = "{emailsendtask.voyageex.length}")
    private String voyageEx;

    @Schema(description = "装货港", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 5)
    @NotBlank(message = "{emailsendtask.polcode.notblank}")
    @Length(max = 5, message = "{emailsendtask.polcode.length}")
    private String polCode;

    @Schema(description = "卸货港")
    private String podCode;

    @Schema(description = "目的港")
    private String delCode;

    @Schema(description = "发送方", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 100)
    @NotBlank(message = "{emailsendtask.sender.notblank}")
    @Length(max = 100, message = "{emailsendtask.sender.length}")
    private String sender;

    @Schema(description = "发送人", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 500)
    @NotBlank(message = "{emailsendtask.recipient.notblank}")
    @Length(max = 500, message = "{emailsendtask.recipient.length}")
    private String recipient;

    @Schema(description = "抄送人", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 500)
    @NotBlank(message = "{emailsendtask.emailcc.notblank}")
    @Length(max = 500, message = "{emailsendtask.emailcc.length}")
    private String emailCc;

    @Schema(description = "发送状态", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 20, example = "1")
    @NotBlank(message = "{emailsendtask.sendstatus.notblank}")
    @Length(max = 20, message = "{emailsendtask.sendstatus.length}")
    private String sendStatus;

    @Schema(description = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date sendTime;

    @Schema(description = "发送邮件类型", requiredMode = Schema.RequiredMode.REQUIRED, maxLength = 20, example = "1")
    @NotBlank(message = "{emailsendtask.emailtype.notblank}")
    @Length(max = 20, message = "{emailsendtask.emailtype.length}")
    private String emailType;

    @Schema(description = "备注", maxLength = 200, example = "你猜")
    @Length(max = 200, message = "{emailsendtask.remark.length}")
    private String remark;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Schema(description = "邮件发送时间间隔(分钟)")
    private String sendTimeInterval;

}
